{extend name="adminheader:header"/}
{block name="content"}
<style type="text/css">
    thead tr th{
        text-align: center;
    }
    tbody tr td{
        text-align: center;
    }
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <input type="hidden" value="{$oid}" id="orderid" />
                            <table class="table table-striped table-hover" id="f3">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>商品名</th>
                                        <th>商品图</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {if condition="$list neq null"}
                                        {volist name="list" id="vo"}
                                            <tr>
                                                <td>{$vo.id}</td>
                                                <td>{$vo.g_name}</td>
                                                <td><img src="{$vo['g_pic']['photos'][0]['url']}" width="50" height="50"  onclick="imagePreviewDialog(this.src);" style="cursor: pointer;"/></td>
                                                <td>
                                                    <a class="btn btn-success infos" id="{$vo.id}" gname="{$vo.g_name}"/>购买的商品数量</a>
                                                </td>
                                            </tr>
                                        {/volist}
                                    {else/}
                                        <tr>
                                            <td style="font-size:20px;text-align:center">暂无数据</td>
                                        </tr>
                                    {/if}
                                </tbody>
                            </table>
                            <div class="text-left pages">
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="/admin/js/admin.js"></script>
<script type="text/javascript">
    /* 查看商品的规格 */
    $('.infos').click(function(){
        var gid = $(this).attr('id');
        var gname = $(this).attr('gname');
        var oid = $('#orderid').val();
        openIframeLayer("{:url('/admin/orders/goodsinfo')}?gid=" + gid+"&oid=" + oid, gname+'的商品数量', {
            area: ['800px', '400px'],
            yes: function (index, layero) {
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    });
</script>
{/block}